//
//  MethodHandler.swift
//  umeng_vertify
//
//  Created by niki on 2021/8/29.
//

import Foundation
//import UMVerify


public class MethodHandler: NSObject {
    
    static let appkey = "5fd0448dfb95730a9f82dd0e"
    static var verifyPageModel = UMCustomModel.init()
    
    static func initUMCommon() {
        
        print("一键登录---初始化友盟sdk---swift")
        
//        UMConfigure.initWithAppkey(appkey, channel: "yyt")
    }
    static func setVerifySDKInfo(secret : String, complete :(([AnyHashable : Any]) -> Void)? = nil) {
        print("一键登录---设置验证sdk密钥---swift")

        UMCommonHandler.setVerifySDKInfo(secret) { resultDic in
            print("setVerifySDKInfo：---\(resultDic)")
            complete!(resultDic)
        }
    }
    static func checkEnvAvailable(type : UMPNSAuthType, complete :(([AnyHashable : Any]) -> Void)? = nil) {
        print("一键登录---验证一键登录可用性---swift")

        UMCommonHandler.checkEnvAvailable(with: type) { resultDic in
            print("checkEnvAvailable：---\(String(describing: resultDic))")
            complete!(resultDic ?? ["errorCode":-2])
        }
    }
    
    static func getLoginTokenWithTimeout(timeOut : TimeInterval) {
        
    }
    
    public static func modelConfig(model : UMCustomModel) {
        print("调用设置model方法---swift--model：\(model)")
        
        verifyPageModel = model
    }
}
